package com.ITArmy.dao;

import com.ITArmy.beans.Focus;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface FocusMapper {
    int deleteByPrimaryKey(Long fId);

    int insert(Focus record);

    int insertSelective(Focus record);

    Focus selectByPrimaryKey(Long fId);

    int updateByPrimaryKeySelective(Focus record);

    int updateByPrimaryKey(Focus record);

    /**
     * 根据关注者id和被关注者id进行删除这条数据
     */
    int cancelFocus(@Param("uId") long uId, @Param("bId") long bId);

    /**
     * 获取用户关注的作者
     */
    List<Focus> selectFocusUsers(long uId);

    /**
     * 获取用户的粉丝
     */
    List<Focus> selectFuns(long uId);

    //查询是否关注过

    Focus checkIsFocus(@Param("autherId") long autherId, @Param("uId") long uId);


    /**
     * 查找粉丝数量
     */
    int fansCount(long uid);

    /**
     * 查找关注数量
     */
    int focusCount(long uid);

}